{extend name="public/basic"}
{block name="main"}
<form class = "layui-form" action="{:url('')}" method="get">
    <div class = "layui-col-xs3">
        <div class = "layui-form-item">
            <label class = "layui-form-label">商品名称</label>
            <div class = "layui-input-block">
                <input type="text" name="name" class = "layui-input" placeholder="请输入商品名称" value="{$where['name']|default=''}" autocomplete="off"/>
            </div>
        </div>
    </div>
    <div class = "layui-form-item">
        <button class="layui-btn layui-btn-success">查询</button>
    </div>
</form>
<table class = "layui-table">
    <thead>
    <tr>
        <th>商品名称</th>
        <th>关键字</th>
        <th>成本价</th>
        <th>售价</th>
        <th>库存</th>
        <th>销量</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    {volist name="records" id="vo"}
    <tr>
        <td>{$vo.name}</td>
        <td>{$vo.keyword}</td>
        <td>{$vo.origcost}</td>
        <td>{$vo.price}</td>
        <td>{$vo.stock}</td>
        <td>{$vo.sale}</td>
        <td>
            {auth:button rules="$buttons" rule="merchant/goods/putoff"}<i class = "layui-icon layui-icon-triangle-d" action="ajax" action-url="{:url('putoff',['id'=>$vo['id']])}"title="下架商品" ></i>{/auth:button}
        </td>
    </tr>
    {/volist}
    </tbody>
</table>
{$records->render()}
{/block}
